use crate::models::Role;
use serde::Serialize;

#[derive(Clone, Debug, PartialEq, Serialize)]
pub struct Attrs {
    pub index: usize, // 序号从1开始
}

#[derive(Clone, Debug, PartialEq, Serialize)]
pub struct Message {
    pub role: Role,
    pub content: String,
    pub attrs: Option<Attrs>,
}

#[derive(Clone, Debug, PartialEq, Serialize)]
pub struct ChatMessage {
    pub tool_call_id: Option<String>,
    pub role: Role,
    pub content: String,
}

impl From<&Message> for ChatMessage {
    fn from(message: &Message) -> Self {
        Self {
            tool_call_id: None,
            role: message.role.clone(),
            content: message.content.clone(),
        }
    }
}
